package com.detali;

public class PolyParameter {
    public static void main(String[] args) {
        Worker jake = new Worker("jake", 25000);
        Manager maike = new Manager("maike", 30000,200000);
        PolyParameter polyParameter = new PolyParameter();
        polyParameter.showEmpAnnul(maike);
        polyParameter.showEmpAnnul(jake);
    }

    public void showEmpAnnul(Employee e){
        System.out.println(e.getAnnul());
    }
    public void testWork(Employee e){
        if(e instanceof Worker){
            ((Worker) e).work();
        }else if(e instanceof Manager){
            ((Manager) e).manage();
        }else{
            System.out.println("不做处理");
        }
    }
}
